package com.aspose.cells;

import java.util.ArrayList;

class zayd {
   static void a(ArrayList var0) {
      int var1;
      int var2;
      do {
         var1 = var0.size();
         b(var0);
         var2 = var0.size();
      } while(var1 != var2);

   }

   static void b(ArrayList var0) {
      int var1 = var0.size();

      for(int var2 = 0; var2 < var1; ++var2) {
         CellArea var3 = (CellArea)var0.get(var2);

         for(int var4 = var2 + 1; var4 < var1; ++var4) {
            CellArea var5 = (CellArea)var0.get(var4);
            boolean var6 = false;
            boolean[] var7 = new boolean[]{var6};
            var3 = a(var3, var5, var7);
            var6 = var7[0];
            if (var6) {
               var0.set(var2, var3);
               var0.remove(var4);
               --var4;
               --var1;
            }
         }
      }

   }

   static CellArea a(CellArea var0, CellArea var1, boolean[] var2) {
      var2[0] = false;
      if (var0.StartColumn == var1.StartColumn && var0.EndColumn == var1.EndColumn) {
         if (var1.StartRow <= var0.StartRow) {
            if (var1.EndRow >= var0.StartRow - 1) {
               var0.StartRow = var1.StartRow;
               var2[0] = true;
            }

            if (var1.EndRow > var0.EndRow) {
               var0.EndRow = var1.EndRow;
               var2[0] = true;
            }
         } else if (var1.StartRow <= var0.EndRow + 1 && var1.EndRow > var0.EndRow) {
            var0.EndRow = var1.EndRow;
            var2[0] = true;
         }
      } else if (var0.StartRow == var1.StartRow && var0.EndRow == var1.EndRow) {
         if (var1.StartColumn <= var0.StartColumn) {
            if (var1.EndColumn >= var0.StartColumn - 1) {
               var0.StartColumn = var1.StartColumn;
               var2[0] = true;
            }

            if (var1.EndColumn > var0.EndColumn) {
               var0.EndColumn = var1.EndColumn;
               var2[0] = true;
            }
         } else if (var1.StartColumn <= var0.EndColumn + 1 && var1.EndColumn > var0.EndColumn) {
            var0.EndColumn = var1.EndColumn;
            var2[0] = true;
         }
      }

      return var0;
   }

   static void a(ArrayList var0, CellArea var1) {
      boolean var2 = false;

      for(int var3 = 0; var3 < var0.size(); ++var3) {
         CellArea var4 = (CellArea)var0.get(var3);
         Object var5 = e(var4, var1);
         if (var5 != null) {
            CellArea var6 = (CellArea)var5;
            if (a(var6, var1)) {
               var0.set(var3, var4);
            } else if (a(var6, var4)) {
               var0.set(var3, var1);
            }

            var2 = true;
            break;
         }

         if (var4.StartRow == var1.StartRow && var4.EndRow == var1.EndRow) {
            if (var1.StartColumn == var4.EndColumn + 1) {
               var4.EndColumn = var1.EndColumn;
               var0.set(var3, var4);
               var2 = true;
               break;
            }

            if (var1.EndColumn == var4.StartColumn + 1) {
               var4.StartColumn = var1.StartColumn;
               var0.set(var3, var4);
               var2 = true;
               break;
            }
         } else if (var4.StartColumn == var1.StartColumn && var4.EndColumn == var1.StartColumn) {
            if (var1.StartRow == var4.EndRow + 1) {
               var4.EndRow = var1.EndRow;
               var0.set(var3, var4);
               var2 = true;
               break;
            }

            if (var1.EndRow == var4.StartRow + 1) {
               var4.StartRow = var1.StartRow;
               var0.set(var3, var4);
               var2 = true;
               break;
            }
         }
      }

      if (!var2) {
         com.aspose.cells.b.a.a.ze.a(var0, (Object)var1);
      }

   }

   static Object a(CellArea var0, int var1, int var2, int var3) {
      Object var4 = b(var0, var1, var2);
      if (var4 == null) {
         return null;
      } else {
         var0 = (CellArea)var4;
         CellArea var5 = new CellArea();
         var5.StartRow = var3 + var0.StartRow - var1;
         var5.StartColumn = var0.StartColumn;
         var5.EndRow = var0.EndRow - var0.StartRow + var5.StartRow;
         var5.EndColumn = var0.EndColumn;
         return var5;
      }
   }

   static CellArea a(CellArea var0, int var1, int var2, boolean[] var3) {
      if (var2 == 0) {
         return var0;
      } else if (var2 < 0 && var0.StartRow >= var1 && var1 - var2 - 1 >= var0.EndRow) {
         var3[0] = true;
         return var0;
      } else {
         if (var0.StartRow >= var1) {
            var0.StartRow += var2;
            if (var0.StartRow < var1) {
               var0.StartRow = var1;
            }

            if (var0.StartRow > 1048575) {
               var3[0] = true;
               return var0;
            }
         }

         if (var0.EndRow >= var1) {
            var0.EndRow += var2;
            if (var0.EndRow > 1048575) {
               var0.EndRow = 1048575;
            } else if (var0.EndRow < var1) {
               var0.EndRow = var1 - 1;
            }
         }

         var3[0] = false;
         return var0;
      }
   }

   static CellArea b(CellArea var0, int var1, int var2, boolean[] var3) {
      if (var2 == 0) {
         return var0;
      } else if (var2 < 0 && var0.StartColumn >= var1 && var1 - var2 - 1 >= var0.EndColumn) {
         var3[0] = true;
         return var0;
      } else {
         if (var0.StartColumn >= var1) {
            var0.StartColumn += var2;
            if (var0.StartColumn < var1) {
               var0.StartColumn = var1;
            }

            if (var0.StartColumn > 16383) {
               var3[0] = true;
               return var0;
            }
         }

         if (var0.EndColumn > var1 - 1) {
            var0.EndColumn += var2;
            if (var0.EndColumn > 16383) {
               var0.EndColumn = 16383;
            } else if (var0.EndColumn < var1) {
               var0.EndColumn = var1 - 1;
            }
         }

         var3[0] = false;
         return var0;
      }
   }

   static boolean a(CellArea var0, CellArea var1) {
      return var0.StartRow == var1.StartRow && var0.StartColumn == var1.StartColumn && var0.EndRow == var1.EndRow && var0.EndColumn == var1.EndColumn;
   }

   static boolean b(CellArea var0, CellArea var1) {
      Object var2 = e(var0, var1);
      if (var2 == null) {
         return true;
      } else {
         return var0.StartRow <= var1.StartRow && var0.EndRow >= var1.EndRow && var0.StartColumn <= var1.StartColumn && var0.StartColumn >= var1.EndColumn;
      }
   }

   static CellArea c(CellArea var0, CellArea var1) {
      int var2 = var0.StartRow < var1.StartRow ? var0.StartRow : var1.StartRow;
      int var3 = var0.StartColumn < var1.StartColumn ? var0.StartColumn : var1.StartColumn;
      int var4 = var0.EndRow > var1.EndRow ? var0.EndRow : var1.EndRow;
      int var5 = var0.EndColumn > var1.EndColumn ? var0.EndColumn : var1.EndColumn;
      CellArea var6 = new CellArea();
      var6.StartRow = var2;
      var6.StartColumn = var3;
      var6.EndRow = var4;
      var6.EndColumn = var5;
      return var6;
   }

   static ArrayList d(CellArea var0, CellArea var1) {
      ArrayList var2 = new ArrayList();
      CellArea var3;
      if (var1.StartRow > var0.StartRow) {
         var3 = new CellArea();
         var3.StartRow = var0.StartRow;
         var3.EndRow = var1.StartRow - 1;
         var3.StartColumn = var0.StartColumn;
         var3.EndColumn = var0.EndColumn;
         com.aspose.cells.b.a.a.ze.a(var2, (Object)var3);
      } else if (var1.EndRow < var0.EndRow) {
         var3 = new CellArea();
         var3.StartRow = var1.EndRow + 1;
         var3.EndRow = var0.EndRow;
         var3.StartColumn = var0.StartColumn;
         var3.EndColumn = var0.EndColumn;
         com.aspose.cells.b.a.a.ze.a(var2, (Object)var3);
      }

      if (var1.StartColumn > var0.StartColumn) {
         var3 = new CellArea();
         var3.StartRow = var1.StartRow;
         var3.EndRow = var1.EndRow;
         var3.StartColumn = var0.StartColumn;
         var3.EndColumn = var1.StartColumn - 1;
         com.aspose.cells.b.a.a.ze.a(var2, (Object)var3);
      } else if (var1.EndColumn < var0.EndColumn) {
         var3 = new CellArea();
         var3.StartRow = var1.StartRow;
         var3.EndRow = var1.EndRow;
         var3.StartColumn = var1.EndColumn + 1;
         var3.EndColumn = var0.EndColumn;
         com.aspose.cells.b.a.a.ze.a(var2, (Object)var3);
      }

      return var2;
   }

   static Object e(CellArea var0, CellArea var1) {
      int var2 = var0.StartRow < var1.StartRow ? var1.StartRow : var0.StartRow;
      int var3 = var0.EndRow > var1.EndRow ? var1.EndRow : var0.EndRow;
      if (var2 > var3) {
         return null;
      } else {
         int var4 = var0.StartColumn < var1.StartColumn ? var1.StartColumn : var0.StartColumn;
         int var5 = var0.EndColumn > var1.EndColumn ? var1.EndColumn : var0.EndColumn;
         if (var4 > var5) {
            return null;
         } else {
            CellArea var6 = new CellArea();
            var6.StartRow = var2;
            var6.EndRow = var3;
            var6.StartColumn = var4;
            var6.EndColumn = var5;
            return var6;
         }
      }
   }

   static ArrayList a(CellArea var0, int var1, int var2) {
      ArrayList var3 = new ArrayList();
      int var4 = var1 + var2 - 1;
      CellArea var5 = new CellArea();
      var5.StartColumn = var0.StartColumn;
      var5.EndColumn = var0.EndColumn;
      if (var1 < var0.StartRow) {
         if (var4 < var0.StartRow) {
            com.aspose.cells.b.a.a.ze.a(var3, (Object)var0);
         } else if (var4 < var0.EndRow) {
            var5.StartRow = var4 + 1;
            var5.EndRow = var0.EndRow;
         }
      } else if (var1 >= var0.StartRow) {
         if (var1 > var0.EndRow) {
            com.aspose.cells.b.a.a.ze.a(var3, (Object)var0);
         } else {
            if (var1 != var0.StartRow) {
               var5.StartRow = var0.StartRow;
               var5.EndRow = var1 - 1;
               com.aspose.cells.b.a.a.ze.a(var3, (Object)var5);
            }

            if (var4 < var0.EndRow) {
               var0.StartRow = var4 + 1;
               com.aspose.cells.b.a.a.ze.a(var3, (Object)var0);
            }
         }
      }

      return var3;
   }

   static Object b(CellArea var0, int var1, int var2) {
      int var3 = var1 + var2 - 1;
      CellArea var4 = new CellArea();
      var4.StartColumn = var0.StartColumn;
      var4.EndColumn = var0.EndColumn;
      if (var1 < var0.StartRow) {
         if (var3 < var0.StartRow) {
            return null;
         }

         if (var3 <= var0.EndRow) {
            var4.StartRow = var0.StartRow;
            var4.EndRow = var3;
         } else {
            var4.StartRow = var0.StartRow;
            var4.EndRow = var0.EndRow;
         }
      } else if (var1 >= var0.StartRow) {
         if (var1 > var0.EndRow) {
            return null;
         }

         if (var3 <= var0.EndRow) {
            var4.StartRow = var1;
            var4.EndRow = var3;
         } else {
            var4.StartRow = var1;
            var4.EndRow = var0.EndRow;
         }
      }

      return var4;
   }

   static Object c(CellArea var0, int var1, int var2) {
      int var3 = var1 + var2 - 1;
      CellArea var4 = new CellArea();
      var4.StartRow = var0.StartRow;
      var4.EndRow = var0.EndRow;
      if (var1 < var0.EndColumn) {
         if (var3 < var0.StartColumn) {
            return null;
         }

         if (var3 <= var0.EndColumn) {
            var4.StartColumn = var0.StartColumn;
            var4.EndColumn = var3;
         } else {
            var4.StartColumn = var0.StartColumn;
            var4.EndColumn = var0.EndColumn;
         }
      } else if (var1 >= var0.EndColumn) {
         if (var1 > var0.EndColumn) {
            return null;
         }

         if (var3 <= var0.EndColumn) {
            var4.StartColumn = var1;
            var4.EndColumn = var3;
         } else {
            var4.StartColumn = var1;
            var4.EndColumn = var0.EndColumn;
         }
      }

      return var4;
   }

   static ArrayList a(boolean var0, CellArea var1, int var2, CellArea var3, boolean[] var4) {
      ArrayList var5 = new ArrayList();
      if (var1.StartColumn <= var3.EndColumn && var1.EndColumn >= var3.StartColumn && var1.StartRow <= var3.EndRow) {
         CellArea var6;
         CellArea var7;
         if (!var0) {
            if (var3.StartRow == 0 && var3.EndRow >= 65535) {
               var4[0] = false;
               return var5;
            } else if (var1.StartColumn <= var3.StartColumn) {
               if (var1.EndColumn >= var3.EndColumn) {
                  if (var1.StartRow <= var3.StartRow) {
                     var3.StartRow += var2;
                     var3.EndRow += var2;
                     if (var3.EndRow > 65535) {
                        var3.EndRow = 65535;
                     }

                     com.aspose.cells.b.a.a.ze.a(var5, (Object)var3);
                     var4[0] = true;
                     return var5;
                  } else {
                     var3.EndRow += var2;
                     com.aspose.cells.b.a.a.ze.a(var5, (Object)var3);
                     var4[0] = true;
                     return var5;
                  }
               } else {
                  if (var1.StartRow <= var3.EndRow) {
                     var6 = new CellArea();
                     var6.StartColumn = var3.StartColumn;
                     var6.EndColumn = var1.EndColumn;
                     var6.StartRow = var3.StartRow + var2;
                     var6.EndRow = var3.EndRow + var2;
                     com.aspose.cells.b.a.a.ze.a(var5, (Object)var6);
                  } else {
                     var6 = new CellArea();
                     var6.StartColumn = var3.StartColumn;
                     var6.EndColumn = var1.EndColumn;
                     var6.StartRow = var3.StartRow;
                     var6.EndRow = var3.EndRow + var2;
                     com.aspose.cells.b.a.a.ze.a(var5, (Object)var6);
                  }

                  var6 = new CellArea();
                  var6.StartRow = var3.StartRow;
                  var6.EndRow = var3.EndRow;
                  var6.StartColumn = var1.EndColumn + 1;
                  var6.EndColumn = var3.EndColumn;
                  com.aspose.cells.b.a.a.ze.a(var5, (Object)var6);
                  var4[0] = true;
                  return var5;
               }
            } else {
               var6 = new CellArea();
               var6.StartRow = var3.StartRow;
               var6.EndRow = var3.EndRow;
               var6.StartColumn = var3.StartColumn;
               var6.EndColumn = var1.StartColumn - 1;
               com.aspose.cells.b.a.a.ze.a(var5, (Object)var6);
               if (var1.EndColumn >= var3.EndColumn) {
                  if (var1.StartRow <= var3.StartRow) {
                     var7 = new CellArea();
                     var7.StartColumn = var1.StartColumn;
                     var7.EndColumn = var3.EndColumn;
                     var7.StartRow = var3.StartRow + var2;
                     var7.EndRow = var3.EndRow + var2;
                     com.aspose.cells.b.a.a.ze.a(var5, (Object)var7);
                  } else {
                     var7 = new CellArea();
                     var7.StartColumn = var1.StartColumn;
                     var7.EndColumn = var3.EndColumn;
                     var7.StartRow = var3.StartRow;
                     var7.EndRow = var3.EndRow + var2;
                     com.aspose.cells.b.a.a.ze.a(var5, (Object)var7);
                  }

                  var4[0] = true;
                  return var5;
               } else {
                  if (var1.StartRow <= var3.StartRow) {
                     var7 = new CellArea();
                     var7.StartColumn = var1.StartColumn;
                     var7.EndColumn = var1.EndColumn;
                     var7.StartRow = var3.StartRow + var2;
                     var7.EndRow = var3.EndRow + var2;
                     if (var7.EndRow > 65535) {
                        var7.EndRow = 65535;
                     }

                     com.aspose.cells.b.a.a.ze.a(var5, (Object)var7);
                  } else {
                     var7 = new CellArea();
                     var7.StartColumn = var1.StartColumn;
                     var7.EndColumn = var1.EndColumn;
                     var7.StartRow = var3.StartRow;
                     var7.EndRow = var3.EndRow + var2;
                     com.aspose.cells.b.a.a.ze.a(var5, (Object)var7);
                  }

                  var7 = new CellArea();
                  var7.StartRow = var3.StartRow;
                  var7.EndRow = var3.EndRow;
                  var7.StartColumn = var1.EndColumn + 1;
                  var7.EndColumn = var3.EndColumn;
                  com.aspose.cells.b.a.a.ze.a(var5, (Object)var7);
                  var4[0] = true;
                  return var5;
               }
            }
         } else if (var3.StartRow == 0 && var3.EndRow >= 1048575) {
            var4[0] = false;
            return var5;
         } else if (var1.StartColumn <= var3.StartColumn) {
            if (var1.EndColumn >= var3.EndColumn) {
               if (var1.StartRow <= var3.StartRow) {
                  var3.StartRow += var2;
                  var3.EndRow += var2;
                  if (var3.EndRow > 1048575) {
                     var3.EndRow = 1048575;
                  }

                  com.aspose.cells.b.a.a.ze.a(var5, (Object)var3);
                  var4[0] = true;
                  return var5;
               } else {
                  var3.EndRow += var2;
                  com.aspose.cells.b.a.a.ze.a(var5, (Object)var3);
                  var4[0] = true;
                  return var5;
               }
            } else {
               if (var1.StartRow <= var3.EndRow) {
                  var6 = new CellArea();
                  var6.StartColumn = var3.StartColumn;
                  var6.EndColumn = var1.EndColumn;
                  var6.StartRow = var3.StartRow + var2;
                  var6.EndRow = var3.EndRow + var2;
                  com.aspose.cells.b.a.a.ze.a(var5, (Object)var6);
               } else {
                  var6 = new CellArea();
                  var6.StartColumn = var3.StartColumn;
                  var6.EndColumn = var1.EndColumn;
                  var6.StartRow = var3.StartRow;
                  var6.EndRow = var3.EndRow + var2;
                  com.aspose.cells.b.a.a.ze.a(var5, (Object)var6);
               }

               var6 = new CellArea();
               var6.StartRow = var3.StartRow;
               var6.EndRow = var3.EndRow;
               var6.StartColumn = var1.EndColumn + 1;
               var6.EndColumn = var3.EndColumn;
               com.aspose.cells.b.a.a.ze.a(var5, (Object)var6);
               var4[0] = true;
               return var5;
            }
         } else {
            var6 = new CellArea();
            var6.StartRow = var3.StartRow;
            var6.EndRow = var3.EndRow;
            var6.StartColumn = var3.StartColumn;
            var6.EndColumn = var1.StartColumn - 1;
            com.aspose.cells.b.a.a.ze.a(var5, (Object)var6);
            if (var1.EndColumn >= var3.EndColumn) {
               if (var1.StartRow <= var3.StartRow) {
                  var7 = new CellArea();
                  var7.StartColumn = var1.StartColumn;
                  var7.EndColumn = var3.EndColumn;
                  var7.StartRow = var3.StartRow + var2;
                  var7.EndRow = var3.EndRow + var2;
                  com.aspose.cells.b.a.a.ze.a(var5, (Object)var7);
               } else {
                  var7 = new CellArea();
                  var7.StartColumn = var1.StartColumn;
                  var7.EndColumn = var3.EndColumn;
                  var7.StartRow = var3.StartRow;
                  var7.EndRow = var3.EndRow + var2;
                  com.aspose.cells.b.a.a.ze.a(var5, (Object)var7);
               }

               var4[0] = true;
               return var5;
            } else {
               if (var1.StartRow <= var3.StartRow) {
                  var7 = new CellArea();
                  var7.StartColumn = var1.StartColumn;
                  var7.EndColumn = var1.EndColumn;
                  var7.StartRow = var3.StartRow + var2;
                  var7.EndRow = var3.EndRow + var2;
                  com.aspose.cells.b.a.a.ze.a(var5, (Object)var7);
               } else {
                  var7 = new CellArea();
                  var7.StartColumn = var1.StartColumn;
                  var7.EndColumn = var1.EndColumn;
                  var7.StartRow = var3.StartRow;
                  var7.EndRow = var3.EndRow + var2;
                  com.aspose.cells.b.a.a.ze.a(var5, (Object)var7);
               }

               var7 = new CellArea();
               var7.StartRow = var3.StartRow;
               var7.EndRow = var3.EndRow;
               var7.StartColumn = var1.EndColumn + 1;
               var7.EndColumn = var3.EndColumn;
               com.aspose.cells.b.a.a.ze.a(var5, (Object)var7);
               var4[0] = true;
               return var5;
            }
         }
      } else {
         var4[0] = false;
         return var5;
      }
   }

   static void a(ArrayList var0, boolean var1, CellArea var2, int var3, ArrayList var4, ArrayList var5) {
      for(int var6 = 0; var6 < var0.size(); ++var6) {
         a(var1, var2, var3, (CellArea)var0.get(var6), var4, var5);
      }

   }

   static void b(ArrayList var0, boolean var1, CellArea var2, int var3, ArrayList var4, ArrayList var5) {
      for(int var6 = 0; var6 < var0.size(); ++var6) {
         c(var1, var2, var3, (CellArea)var0.get(var6), var4, var5);
      }

   }

   static void a(boolean var0, CellArea var1, int var2, CellArea var3, ArrayList var4, ArrayList var5) {
      if (var1.StartColumn <= var3.EndColumn && var1.EndColumn >= var3.StartColumn && var1.StartRow <= var3.EndRow) {
         if (!var0) {
            if (var3.StartRow == 0 && var3.EndRow >= 65535) {
               com.aspose.cells.b.a.a.ze.a(var4, (Object)var3);
               return;
            }
         } else if (var3.StartRow == 0 && var3.EndRow >= 1048575) {
            com.aspose.cells.b.a.a.ze.a(var4, (Object)var3);
            return;
         }

         CellArea var6;
         if (var1.StartColumn <= var3.StartColumn) {
            if (var1.EndColumn >= var3.EndColumn) {
               if (var1.StartRow <= var3.StartRow) {
                  var3.StartRow += var2;
                  var3.EndRow += var2;
                  com.aspose.cells.b.a.a.ze.a(var5, (Object)var3);
               } else {
                  var3.EndRow += var2;
                  com.aspose.cells.b.a.a.ze.a(var4, (Object)var3);
               }
            } else {
               if (var1.StartRow <= var3.EndRow) {
                  var6 = new CellArea();
                  var6.StartColumn = var3.StartColumn;
                  var6.EndColumn = var1.EndColumn;
                  var6.StartRow = var3.StartRow + var2;
                  var6.EndRow = var3.EndRow + var2;
                  com.aspose.cells.b.a.a.ze.a(var5, (Object)var6);
               } else {
                  var6 = new CellArea();
                  var6.StartColumn = var3.StartColumn;
                  var6.EndColumn = var1.EndColumn;
                  var6.StartRow = var3.StartRow;
                  var6.EndRow = var3.EndRow + var2;
                  com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
               }

               var6 = new CellArea();
               var6.StartRow = var3.StartRow;
               var6.EndRow = var3.EndRow;
               var6.StartColumn = var1.EndColumn + 1;
               var6.EndColumn = var3.EndColumn;
               com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
            }
         } else {
            var6 = new CellArea();
            var6.StartRow = var3.StartRow;
            var6.EndRow = var3.EndRow;
            var6.StartColumn = var3.StartColumn;
            var6.EndColumn = var1.StartColumn - 1;
            com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
            CellArea var7;
            if (var1.EndColumn >= var3.EndColumn) {
               if (var1.StartRow <= var3.StartRow) {
                  var7 = new CellArea();
                  var7.StartColumn = var1.StartColumn;
                  var7.EndColumn = var3.EndColumn;
                  var7.StartRow = var3.StartRow + var2;
                  var7.EndRow = var3.EndRow + var2;
                  com.aspose.cells.b.a.a.ze.a(var5, (Object)var7);
               } else {
                  var7 = new CellArea();
                  var7.StartColumn = var1.StartColumn;
                  var7.EndColumn = var3.EndColumn;
                  var7.StartRow = var3.StartRow;
                  var7.EndRow = var3.EndRow + var2;
                  com.aspose.cells.b.a.a.ze.a(var4, (Object)var7);
               }
            } else {
               if (var1.StartRow <= var3.StartRow) {
                  var7 = new CellArea();
                  var7.StartColumn = var1.StartColumn;
                  var7.EndColumn = var1.EndColumn;
                  var7.StartRow = var3.StartRow + var2;
                  var7.EndRow = var3.EndRow + var2;
                  com.aspose.cells.b.a.a.ze.a(var5, (Object)var7);
               } else {
                  var7 = new CellArea();
                  var7.StartColumn = var1.StartColumn;
                  var7.EndColumn = var1.EndColumn;
                  var7.StartRow = var3.StartRow;
                  var7.EndRow = var3.EndRow + var2;
                  com.aspose.cells.b.a.a.ze.a(var4, (Object)var7);
               }

               var7 = new CellArea();
               var7.StartRow = var3.StartRow;
               var7.EndRow = var3.EndRow;
               var7.StartColumn = var1.EndColumn + 1;
               var7.EndColumn = var3.EndColumn;
               com.aspose.cells.b.a.a.ze.a(var4, (Object)var7);
            }
         }

      } else {
         com.aspose.cells.b.a.a.ze.a(var4, (Object)var3);
      }
   }

   static void b(boolean var0, CellArea var1, int var2, CellArea var3, ArrayList var4, ArrayList var5) {
      if (var1.StartRow <= var3.StartRow) {
         if (var1.EndRow < var3.StartRow) {
            var3.StartRow -= var2;
            var3.EndRow -= var2;
            com.aspose.cells.b.a.a.ze.a(var5, (Object)var3);
         } else if (var1.EndRow < var3.EndRow) {
            CellArea var6 = CellArea.createCellArea(var1.EndRow + 1, var3.StartColumn, var3.EndRow, var3.EndColumn);
            var6.StartRow -= var2;
            var6.EndRow -= var2;
            com.aspose.cells.b.a.a.ze.a(var5, (Object)var6);
         }
      } else if (var1.EndRow < var3.EndRow) {
         var3.EndRow -= var2;
         com.aspose.cells.b.a.a.ze.a(var5, (Object)var3);
      } else {
         var3.EndRow = var1.StartRow - 1;
         com.aspose.cells.b.a.a.ze.a(var5, (Object)var3);
      }

   }

   static void c(boolean var0, CellArea var1, int var2, CellArea var3, ArrayList var4, ArrayList var5) {
      if (var1.StartColumn <= var3.EndColumn && var1.EndColumn >= var3.StartColumn && var1.StartRow <= var3.EndRow) {
         if (!var0) {
            if (var3.StartRow == 0 && var3.EndRow >= 65535) {
               com.aspose.cells.b.a.a.ze.a(var4, (Object)var3);
               return;
            }
         } else if (var3.StartRow == 0 && var3.EndRow >= 1048575) {
            com.aspose.cells.b.a.a.ze.a(var4, (Object)var3);
            return;
         }

         CellArea var6;
         CellArea var7;
         if (var1.StartColumn <= var3.StartColumn) {
            if (var1.EndColumn >= var3.EndColumn) {
               b(var0, var1, var2, var3, var4, var5);
            } else {
               var6 = CellArea.createCellArea(var3.StartRow, var3.StartColumn, var3.EndRow, var1.EndColumn);
               b(var0, var1, var2, var6, var4, var5);
               var7 = CellArea.createCellArea(var3.StartRow, var1.EndColumn + 1, var3.EndRow, var3.EndColumn);
               com.aspose.cells.b.a.a.ze.a(var4, (Object)var7);
            }
         } else {
            var6 = CellArea.createCellArea(var3.StartRow, var3.StartColumn, var3.EndRow, var1.StartColumn - 1);
            com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
            var7 = CellArea.createCellArea(var3.StartRow, var1.StartColumn, var3.EndRow, var3.EndColumn);
            if (var1.EndColumn >= var3.EndColumn) {
               b(var0, var1, var2, var7, var4, var5);
            } else {
               CellArea var8 = CellArea.createCellArea(var3.StartRow, var1.StartColumn, var3.EndRow, var1.EndColumn);
               b(var0, var1, var2, var8, var4, var5);
               var7.StartColumn = var1.EndColumn + 1;
               com.aspose.cells.b.a.a.ze.a(var4, (Object)var7);
            }
         }

      } else {
         com.aspose.cells.b.a.a.ze.a(var4, (Object)var3);
      }
   }

   static ArrayList b(CellArea var0, CellArea var1, boolean[] var2) {
      ArrayList var3 = new ArrayList();
      if (var0.StartColumn <= var1.EndColumn && var0.EndColumn >= var1.StartColumn && var0.StartRow <= var1.EndRow) {
         CellArea var4;
         CellArea var5;
         if (var0.StartColumn <= var1.StartColumn) {
            if (var0.EndColumn >= var1.EndColumn) {
               var2[0] = true;
               return var3;
            } else {
               var4 = new CellArea();
               var4.StartColumn = var1.StartColumn;
               var4.EndColumn = var0.EndColumn;
               var4.StartRow = var1.StartRow;
               var4.EndRow = var1.EndRow;
               com.aspose.cells.b.a.a.ze.a(var3, (Object)var4);
               var5 = new CellArea();
               var5.StartRow = var1.StartRow;
               var5.EndRow = var1.EndRow;
               var5.StartColumn = var0.EndColumn + 1;
               var5.EndColumn = var1.EndColumn;
               com.aspose.cells.b.a.a.ze.a(var3, (Object)var5);
               var2[0] = true;
               return var3;
            }
         } else {
            var4 = new CellArea();
            var4.StartRow = var1.StartRow;
            var4.EndRow = var1.EndRow;
            var4.StartColumn = var1.StartColumn;
            var4.EndColumn = var0.StartColumn - 1;
            com.aspose.cells.b.a.a.ze.a(var3, (Object)var4);
            if (var0.EndColumn >= var1.EndColumn) {
               var5 = new CellArea();
               var5.StartColumn = var0.StartColumn;
               var5.EndColumn = var1.EndColumn;
               var5.StartRow = var1.StartRow;
               var5.EndRow = var1.EndRow;
               com.aspose.cells.b.a.a.ze.a(var3, (Object)var5);
               var2[0] = true;
               return var3;
            } else {
               var5 = new CellArea();
               var5.StartColumn = var0.StartColumn;
               var5.EndColumn = var0.EndColumn;
               var5.StartRow = var1.StartRow;
               var5.EndRow = var1.EndRow;
               com.aspose.cells.b.a.a.ze.a(var3, (Object)var5);
               CellArea var6 = new CellArea();
               var6.StartRow = var1.StartRow;
               var6.EndRow = var1.EndRow;
               var6.StartColumn = var0.EndColumn + 1;
               var6.EndColumn = var1.EndColumn;
               com.aspose.cells.b.a.a.ze.a(var3, (Object)var6);
               var2[0] = true;
               return var3;
            }
         }
      } else {
         var2[0] = false;
         return var3;
      }
   }

   static void c(ArrayList var0, boolean var1, CellArea var2, int var3, ArrayList var4, ArrayList var5) {
      for(int var6 = 0; var6 < var0.size(); ++var6) {
         f(var1, var2, var3, (CellArea)var0.get(var6), var4, var5);
      }

   }

   static void d(ArrayList var0, boolean var1, CellArea var2, int var3, ArrayList var4, ArrayList var5) {
      for(int var6 = 0; var6 < var0.size(); ++var6) {
         d(var1, var2, var3, (CellArea)var0.get(var6), var4, var5);
      }

   }

   static void d(boolean var0, CellArea var1, int var2, CellArea var3, ArrayList var4, ArrayList var5) {
      if (var1.StartRow <= var3.EndRow && var1.EndRow >= var3.StartRow && var1.StartColumn <= var3.EndColumn) {
         if (var0) {
            if (var3.StartColumn == 0 && var3.EndColumn == 16383) {
               com.aspose.cells.b.a.a.ze.a(var4, (Object)var3);
               return;
            }
         } else if (var3.StartColumn == 0 && var3.EndColumn == 255) {
            com.aspose.cells.b.a.a.ze.a(var4, (Object)var3);
            return;
         }

         CellArea var6;
         CellArea var7;
         if (var1.StartRow <= var3.StartRow) {
            if (var1.EndRow >= var3.EndRow) {
               if (var1.StartColumn <= var3.StartColumn) {
                  var3.StartColumn += var2;
                  var3.EndColumn += var2;
                  com.aspose.cells.b.a.a.ze.a(var5, (Object)var3);
               } else {
                  var3.EndColumn += var2;
                  com.aspose.cells.b.a.a.ze.a(var4, (Object)var3);
               }
            } else if (var1.StartColumn <= var3.StartColumn) {
               var6 = new CellArea();
               var6.StartRow = var3.StartRow;
               var6.EndRow = var1.EndRow;
               var6.StartColumn = var3.StartColumn + var2;
               var6.EndColumn = var3.EndColumn + var2;
               com.aspose.cells.b.a.a.ze.a(var5, (Object)var6);
               var7 = new CellArea();
               var7.StartRow = var1.EndRow + 1;
               var7.EndRow = var3.EndRow;
               var7.StartColumn = var3.StartColumn;
               var7.EndColumn = var3.EndColumn;
               com.aspose.cells.b.a.a.ze.a(var4, (Object)var7);
            } else {
               var6 = new CellArea();
               var6.StartRow = var3.StartRow;
               var6.EndRow = var1.EndRow;
               var6.StartColumn = var3.StartColumn;
               var6.EndColumn = var3.EndColumn + var2;
               com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
               var7 = new CellArea();
               var7.StartRow = var1.EndRow + 1;
               var7.EndRow = var3.EndRow;
               var7.StartColumn = var3.StartColumn;
               var7.EndColumn = var3.EndColumn;
               com.aspose.cells.b.a.a.ze.a(var4, (Object)var7);
            }
         } else {
            var6 = new CellArea();
            var6.StartColumn = var3.StartColumn;
            var6.EndColumn = var3.EndColumn;
            var6.StartRow = var3.StartRow;
            var6.EndRow = var1.StartRow - 1;
            com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
            if (var1.EndRow >= var3.EndRow) {
               if (var1.StartColumn <= var3.StartColumn) {
                  var7 = new CellArea();
                  var7.StartRow = var1.StartRow;
                  var7.EndRow = var3.EndRow;
                  var7.StartColumn = var3.StartColumn + var2;
                  var7.EndColumn = var3.EndColumn + var2;
                  com.aspose.cells.b.a.a.ze.a(var5, (Object)var7);
               } else {
                  var7 = new CellArea();
                  var7.StartRow = var1.StartRow;
                  var7.EndRow = var3.EndRow;
                  var7.StartColumn = var3.StartColumn;
                  var7.EndColumn = var3.EndColumn + var2;
                  com.aspose.cells.b.a.a.ze.a(var4, (Object)var7);
               }
            } else {
               if (var1.StartColumn <= var3.StartColumn) {
                  var7 = new CellArea();
                  var7.StartRow = var1.StartRow;
                  var7.EndRow = var1.EndRow;
                  var7.StartColumn = var3.StartColumn + var2;
                  var7.EndColumn = var3.EndColumn + var2;
                  com.aspose.cells.b.a.a.ze.a(var5, (Object)var7);
               } else {
                  var7 = new CellArea();
                  var7.StartRow = var1.StartRow;
                  var7.EndRow = var1.EndRow;
                  var7.StartColumn = var3.StartColumn;
                  var7.EndColumn = var3.EndColumn + var2;
                  com.aspose.cells.b.a.a.ze.a(var4, (Object)var7);
               }

               var7 = new CellArea();
               var7.StartColumn = var3.StartColumn;
               var7.EndColumn = var3.EndColumn;
               var7.StartRow = var1.EndRow + 1;
               var7.EndRow = var3.EndRow;
               com.aspose.cells.b.a.a.ze.a(var4, (Object)var7);
            }
         }
      } else {
         com.aspose.cells.b.a.a.ze.a(var4, (Object)var3);
      }
   }

   static void e(boolean var0, CellArea var1, int var2, CellArea var3, ArrayList var4, ArrayList var5) {
      if (var1.StartColumn <= var3.StartColumn) {
         if (var1.EndColumn < var3.StartColumn) {
            var3.StartColumn -= var2;
            var3.EndColumn -= var2;
            com.aspose.cells.b.a.a.ze.a(var5, (Object)var3);
         } else if (var1.EndColumn < var3.EndColumn) {
            CellArea var6 = CellArea.createCellArea(var3.StartRow, var1.EndColumn + 1, var3.EndRow, var3.EndColumn);
            var6.StartColumn -= var2;
            var6.EndColumn -= var2;
            com.aspose.cells.b.a.a.ze.a(var5, (Object)var6);
         }
      } else if (var1.EndColumn < var3.EndColumn) {
         var3.EndColumn -= var2;
         com.aspose.cells.b.a.a.ze.a(var5, (Object)var3);
      } else {
         var3.EndColumn = var1.StartColumn - 1;
         com.aspose.cells.b.a.a.ze.a(var5, (Object)var3);
      }

   }

   static void f(boolean var0, CellArea var1, int var2, CellArea var3, ArrayList var4, ArrayList var5) {
      if (var1.StartRow <= var3.EndRow && var1.EndRow >= var3.StartRow && var1.StartColumn <= var3.EndColumn) {
         if (var0) {
            if (var3.StartColumn == 0 && var3.EndColumn == 16383) {
               com.aspose.cells.b.a.a.ze.a(var4, (Object)var3);
               return;
            }
         } else if (var3.StartColumn == 0 && var3.EndColumn == 255) {
            com.aspose.cells.b.a.a.ze.a(var4, (Object)var3);
            return;
         }

         CellArea var6;
         CellArea var7;
         if (var1.StartRow <= var3.StartRow) {
            if (var1.EndRow >= var3.EndRow) {
               e(var0, var1, var2, var3, var4, var5);
            } else {
               var6 = CellArea.createCellArea(var3.StartRow, var3.StartColumn, var1.EndRow, var3.EndColumn);
               e(var0, var1, var2, var6, var4, var5);
               var7 = CellArea.createCellArea(var1.EndRow + 1, var3.StartColumn, var3.EndRow, var3.EndColumn);
               com.aspose.cells.b.a.a.ze.a(var4, (Object)var7);
            }
         } else {
            var6 = CellArea.createCellArea(var3.StartRow, var3.StartColumn, var1.StartRow - 1, var3.EndColumn);
            com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
            var7 = CellArea.createCellArea(var1.StartRow, var3.StartColumn, var3.EndRow, var3.EndColumn);
            if (var1.EndRow < var3.EndRow) {
               CellArea var8 = CellArea.createCellArea(var1.StartRow, var3.StartColumn, var1.EndRow, var3.EndColumn);
               e(var0, var1, var2, var8, var4, var5);
               var7.StartRow = var1.EndRow + 1;
               com.aspose.cells.b.a.a.ze.a(var4, (Object)var7);
               return;
            }

            e(var0, var1, var2, var7, var4, var5);
         }

      } else {
         com.aspose.cells.b.a.a.ze.a(var4, (Object)var3);
      }
   }
}
